home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- button.gadget/--datasheet--
- button.gadget/GM_GOACTIVE
- button.gadget/GM_GOINACTIVE
- button.gadget/GM_HANDLEINPUT
- button.gadget/GM_HITTEST
- button.gadget/GM_LAYOUT
- button.gadget/GM_RENDER
- button.gadget/OM_NEW
- button.gadget/OM_SET
- button.gadget/--datasheet-- button.gadget/--datasheet--
-
- NAME
- button.gadget--Action button (V42)
-
- SUPERCLASS
- gadgetclass
-
- DESCRIPTION
- The button gadget class is used to create action buttons that are
- momentary, toggle and sticky. This class also supports relativity
- and placement within the window border.
-
- An advantage that this class provides that the system buttongclass
- doesn't support fully is:
-
- o Centered images.
-
- o Centered pen-sensitive glyphs.
-
- o Ability to change the text and background colors for normal
- and selected buttons.
-
- METHODS
- OM_NEW--Create the button gadget. Passed to superclass, then OM_SET.
-
- OM_SET--Set object attributes. Passed to superclass first.
-
- OM_UPDATE--Set object notification attributes. Passed to superclass
- first.
-
- GM_LAYOUT--Calculate gadget imagry positioning. Passed to superclass
- first.
-
- GM_RENDER--Renders the gadget imagry. Overrides the superclass.
-
- GM_HITTEST--Determines if mouse is within the gadget rectangle. Over-
- rides the superclass.
-
- GM_GOACTIVE--Handles activation, toggle-select and button-select.
- Overrides the superclass.
-
- GM_HANDLEINPUT--Handles input events once active. Handles cycle
- buttons, repeat and RMB abort. Overrides the superclass.
-
- GM_GOINACTIVE--Deselects the button. Overrides the superclass.
-
- All other methods are passed to the superclass, including OM_DISPOSE.
-
- ATTRIBUTES
- GA_ToggleSelect (BOOL) -- Indicate that the gadget is a toggle button.
- Defaults to FALSE.
-
- GA_Selected (BOOL) -- Determines whether the button is selected or
- not. Changing selection state will invoke GM_RENDER. Setting
- selected causes BUTTON_Current to go to 1. Clearing selected
- causes BUTTON_Current to go to 0. Defaults to FALSE.
-
- GA_Disabled (BOOL) -- Determines whether the button is disabled or
- not. Changing disable state will invoke GM_RENDER. A disabled
- button's border and label are all rendered in SHADOWPEN and then
- dusted in a ghosting pattern that is rendered in SHADOWPEN.
- Defaults to FALSE.
-
- GA_Text (STRPTR) -- Used to specify the NULL terminated string to use
- as the text for the gadget. The Text() function is used to draw
- the text. The class does not currently support underlining of
- the keyboard shortcut character. NULL is valid input. Changing
- the label will invoke GM_LAYOUT and then GM_RENDER.
-
- GA_Image (struct Image *) -- Used to specify the image to use for the
- label of the gadget. The DrawImage() function is used to draw
- the image. NULL is valid input. Changing the label will invoke
- GM_LAYOUT and then GM_RENDER.
-
- GA_TextAttr (struct TextAttr *) -- Text attribute for the font to
- use for the labels.
-
- GA_ReadOnly (BOOL) -- Read-only gadgets ignore activation attempts.
- Defaults to FALSE.
-
- BUTTON_Glyph (struct Image *) -- Used to specify the image to use for
- the label of the gadget. The BltTemplate() function is used to
- draw each plane of the image. NULL is valid input. Changing the
- label will invoke GM_LAYOUT and then GM_RENDER.
-
- BUTTON_PushButton (BOOL) -- Used to indicate that the button stays
- pressed in when the user selects it with the mouse. The button
- may programmatically be deselected using {GA_Selected, FALSE}.
- Defaults to FALSE.
-
- BUTTON_Array (LONG) -- Indicates that the label is an array, and
- indicates the number of elements in the array. This allows the
- gadget to be used as a checkbox or a cycle gadget without the
- cycle glyph. Defaults to 1.
-
- BUTTON_Current (LONG) -- Used to select the current image from the
- BUTTON_Array. Changing the current image will invoke GM_LAYOUT
- and then GM_RENDER. Defaults to zero.
-
- BUTTON_TextPen (LONG) -- Indicate the pen number used to render the
- IDS_NORMAL text. If -1 is specified, then TEXTPEN is used.
- Defaults to -1.
-
- BUTTON_BackgroundPen (LONG) -- Indicate the pen number used to render
- the IDS_NORMAL background. If -1 is specified, then BACKGROUNDPEN
- is used. Defaults to -1.
-
- BUTTON_FillTextPen (LONG) -- Indicate the pen number used to render
- the IDS_SELECTED text. If -1 is specified, then FILLTEXTPEN is
- used. Defaults to -1.
-
- BUTTON_FillPen (LONG) -- Indicate the pen number used to render the
- IDS_SELECTED background. If -1 is specified, then FILLPEN is used
- .
- Defaults to -1.
-
- button.gadget/GM_GOACTIVE button.gadget/GM_GOACTIVE
-
- NAME
- GM_GOACTIVE--Activate a gadget. (V42)
-
- FUNCTION
- The GM_GOACTIVE method is used to indicate to a gadget that it has
- become active. This method overrides the superclass.
-
- GA_ToggleSelect: Toggles selection state.
-
- BUTTON_PushButton: If not selected, then becomes selected and sets
- BUTTON_Current to 1. If selected and BUTTON_Array is greater than
- one, then will cycle through the array, while staying selected,
- with 1 being the lower bounds.
-
- BUTTON_Array: Sets selection state and cycle through the array with 0
- being the lower bounds.
-
- Otherwise: Sets selection state.
-
- Invokes GM_RENDER with GREDRAW_REDRAW set.
-
- RESULT
- For GA_ToggleSelect returns GMR_VERIFY | GMR_NOREUSE.
-
- For BUTTON_PushButton returns GMR_VERIFY | GMR_NOREUSE when the
- state changes, otherwise returns GMR_NOREUSE.
-
- All other cases returns GMR_MEACTIVE.
-
- Sets the *msg->gpi_Termination field to BUTTON_Current, which in turn
- fills in the IntuiMessage->Code field.
-
- button.gadget/GM_GOINACTIVE button.gadget/GM_GOINACTIVE
-
- NAME
- GM_GOINACTIVE--Button has lost activation. (V42)
-
- FUNCTION
- The GM_GOINACTIVE method is used to indicate that the button has
- become inactive. This method overrides the superclass.
-
- For momentary buttons, this will cause the GFLG_SELECTED flag to be
- cleared and the GM_RENDER method to be called with GREDRAW_REDRAW.
-
- RESULT
- This method returns 0.
-
- button.gadget/GM_HANDLEINPUT button.gadget/GM_HANDLEINPUT
-
- NAME
- GM_HANDLEINPUT--Handle input events. (V42)
-
- FUNCTION
- The GM_HANDLEINPUT method is used to handle the input events of an
- active button gadget. This method overrides the superclass.
-
- This method correctly handles RMB abort.
-
- RESULT
- This method returns GMR_MEACTIVE as long as the gadget is active.
-
- button.gadget/GM_HITTEST button.gadget/GM_HITTEST
-
- NAME
- GM_HITTEST--Is gadget hit. (V42)
-
- FUNCTION
- The GM_HITTEST method is used to determine if the given mouse
- coordinates are within the domain of the button. This method
- overrides the superclass.
-
- RESULT
- This method returns GMR_GADGETHIT if within the domain, otherwise
- zero is returned.
-
- If the gadget is GA_ReadOnly, then zero is always returned.
-
- button.gadget/GM_LAYOUT button.gadget/GM_LAYOUT
-
- NAME
- GM_LAYOUT--Calculate the positioning of the imagry. (V42)
-
- FUNCTION
- The GM_LAYOUT method is used to calculate the domain of the button
- and to center the label within the domain. This method is passed to
- the superclass first.
-
- Gadget relativity is fully supported.
-
- RESULT
- This method returns 0.
-
- button.gadget/GM_RENDER button.gadget/GM_RENDER
-
- NAME
- GM_RENDER--Render the visuals of the button. (V42)
-
- FUNCTION
- The GM_RENDER method is used to render the visuals of the button.
- This method overrides the superclass.
-
- The border of the gadget is drawn first. Disabled gadgets get a
- border that is drawn completely in SHADOWPEN. A selected or
- read-only button gets SHADOWPEN for the left and top sides, and
- SHINEPEN for the right and bottom sides. A normal button gets
- SHINEPEN for the left and top sides, and SHADOWPEN for the
- right and bottom sides.
-
- The inside of the button is then drawn. A normal button gets
- filled with BUTTON_BackgroundPen. A selected button gets filled
- with BUTTON_FillPen.
-
- Then the label is drawn.
-
- GA_Text: Text() is used to render the text. BUTTON_TextPen
- is used for a normal button and BUTTON_FillTextPen is used for a
- selected button.
-
- GA_Image: DrawImageState() is used to render the image. Note
- that the background pen color is already set appropriately for
- the image state.
-
- BUTTON_Glyph: BltTemplate() is used to render each of the planes
- of the image. BUTTON_TextPen is used for a normal button and
- BUTTON_FillTextPen is used for a selected button. The second
- and higher planes are render using SHADOWPEN.
-
- If the button is disabled, then the ghosting pattern is applied.
-
- RESULT
- This method returns 0.
-
- button.gadget/OM_NEW button.gadget/OM_NEW
-
- NAME
- OM_NEW--Create a button.gadget object. (V42)
-
- FUNCTION
- The OM_NEW method is used to create an instance of the button.gadget
- class. This method is passed to the superclass first.
-
- ATTRIBUTES
- The following attributes can be specified at creation time.
-
- GA_ToggleSelect (BOOL) -- Indicate that the gadget is a toggle button.
- Defaults to FALSE.
-
- GA_Selected (BOOL) -- Determines whether the button is selected or
- not. Defaults to FALSE.
-
- GA_Disabled (BOOL) -- Determines whether the button is disabled or
- not. Defaults to FALSE.
-
- GA_Text (STRPTR) -- Used to specify the NULL terminated string to use
- as the text for the gadget.
-
- GA_Image (struct Image *) -- Used to specify the image to use for the
- label of the gadget.
-
- GA_TextAttr (struct TextAttr *) -- Text attribute for the font to
- use for the labels.
-
- GA_ReadOnly (BOOL) -- Read-only gadgets ignore activation attempts.
- Defaults to FALSE.
-
- BUTTON_Glyph (struct Image *) -- Used to specify the image to use for
- the label of the gadget.
-
- BUTTON_PushButton (BOOL) -- Used to indicate that the button stays
- pressed in when the user selects it with the mouse. The button
- may programmatically be deselected using {GA_Selected, FALSE}.
- Defaults to FALSE.
-
- BUTTON_Array (LONG) -- Indicates that the label is an array, and
- indicates the number of elements in the array. This allows the
- gadget to be used as a checkbox or a cycle gadget without the
- cycle glyph. Defaults to 1.
-
- BUTTON_Current (LONG) -- Used to select the current image from the
- BUTTON_Array. Defaults to zero.
-
- BUTTON_TextPen (LONG) -- Indicate the pen number used to render the
- IDS_NORMAL text. If -1 is specified, then TEXTPEN is used.
- Defaults to -1.
-
- BUTTON_BackgroundPen (LONG) -- Indicate the pen number used to render
- the IDS_NORMAL background. If -1 is specified, then BACKGROUNDPEN
- is used. Defaults to -1.
-
- BUTTON_FillTextPen (LONG) -- Indicate the pen number used to render
- the IDS_SELECTED text. If -1 is specified, then FILLTEXTPEN is
- used. Defaults to -1.
-
- BUTTON_FillPen (LONG) -- Indicate the pen number used to render the
- IDS_SELECTED background. If -1 is specified, then FILLPEN is used
- .
- Defaults to -1.
-
- RESULT
- If the object was created then a pointer to the object is returned,
- otherwise NULL is returned.
-
- button.gadget/OM_SET button.gadget/OM_SET
-
- NAME
- OM_SET--Set the attributes of a button.gadget object. (V42)
-
- FUNCTION
- The OM_SET method is used to set the attributes of a button.gadget.
- This method is passed to the superclass first.
-
- ATTRIBUTES
- The following attributes can be changed at OM_SET or OM_UPDATE.
-
- GA_Selected (BOOL) -- Determines whether the button is selected or
- not. Changing selection state will invoke GM_RENDER. Setting
- selected causes BUTTON_Current to go to 1. Clearing selected
- causes BUTTON_Current to go to 0. Defaults to FALSE.
-
- GA_Disabled (BOOL) -- Determines whether the button is disabled or
- not. Changing disable state will invoke GM_RENDER. A disabled
- button's border and label are all rendered in SHADOWPEN and then
- dusted in a ghosting pattern that is rendered in SHADOWPEN.
- Defaults to FALSE.
-
- GA_Text (STRPTR) -- Used to specify the NULL terminated string to use
- as the text for the gadget. The Text() function is used to draw
- the text. The class does not currently support underlining of
- the keyboard shortcut character. NULL is valid input. Changing
- the label will invoke GM_LAYOUT and then GM_RENDER.
-
- GA_Image (struct Image *) -- Used to specify the image to use for the
- label of the gadget. The DrawImage() function is used to draw
- the image. NULL is valid input. Changing the label will invoke
- GM_LAYOUT and then GM_RENDER.
-
- GA_TextAttr (struct TextAttr *) -- Text attribute for the font to
- use for the labels.
-
- GA_ReadOnly (BOOL) -- Read-only gadgets ignore activation attempts.
- Defaults to FALSE.
-
- BUTTON_Glyph (struct Image *) -- Used to specify the image to use for
- the label of the gadget. The BltTemplate() function is used to
- draw each plane of the image. NULL is valid input. Changing the
- label will invoke GM_LAYOUT and then GM_RENDER.
-
- BUTTON_Current (LONG) -- Used to select the current image from the
- BUTTON_Array. Changing the current image will invoke GM_LAYOUT
- and then GM_RENDER. Defaults to zero.
-
- BUTTON_TextPen (LONG) -- Indicate the pen number used to render the
- IDS_NORMAL text. If -1 is specified, then TEXTPEN is used.
- Defaults to -1. Changing the pen will invoke GM_RENDER.
-
- BUTTON_BackgroundPen (LONG) -- Indicate the pen number used to render
- the IDS_NORMAL background. If -1 is specified, then BACKGROUNDPEN
- is used. Defaults to -1. Changing the pen will invoke GM_RENDER.
-
- BUTTON_FillTextPen (LONG) -- Indicate the pen number used to render
- the IDS_SELECTED text. If -1 is specified, then FILLTEXTPEN is
- used. Defaults to -1. Changing the pen will invoke GM_RENDER.
-
- BUTTON_FillPen (LONG) -- Indicate the pen number used to render the
- IDS_SELECTED background. If -1 is specified, then FILLPEN is used
- .
- Defaults to -1. Changing the pen will invoke GM_RENDER.
-
- RESULT
- The class will update the attributes of object. Changing some
- attributes will result in GM_LAYOUT and/or GM_RENDER being called.
-
- The return value will be non-zero if the gadget needs to be refreshed.
-
-